package com.zeildlin.seecode.Service;

import com.zeildlin.seecode.Dao.Mapper.CommentMapper;
import com.zeildlin.seecode.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {
    @Autowired(required = false)
    CommentMapper commentMapper;
    @Autowired
    RedisTemplate redisTemplate;

    public List<Comment> findCommentsByEntity(int entityType, int entityId, int offset, int limit){
        return commentMapper.selectCommentsByEntity(entityType,entityId,offset,limit);
    }

    public int findCommentCount(int entityType,int entityId){
        return commentMapper.selectCountByEntity(entityType,entityId);
    }


}
